#pragma once

#include "Enums.h"
#include "Defines.h"
#include "SDL.h"
#include "SDL_image.h"

class cDropObject
{
private:
	int m_X;

	int m_Y;

	SDL_Surface* m_Surf_Display;

	DropType m_Type;

	int m_SpeedY;

	int m_Width;
	int m_Height;

	bool CatchState;

	bool LifeState;

	bool CountState;
public:

	cDropObject();
	cDropObject(int x, int y, DropType Type, int w, int h, bool state, bool life, int lev):
	m_X(x),m_Y(y),m_Type(Type),m_Width(w), m_Height(h),CatchState(state), LifeState(life)
	{
		m_SpeedY = DROP_SPEED + lev;
		CountState = false;
	}

	cDropObject(const cDropObject *x)
	{
		m_X = x->m_X;
		m_Y = x->m_Y;
		m_SpeedY = x->m_SpeedY;
		m_Surf_Display = x->m_Surf_Display;
		m_Type = x->m_Type;
		m_Width = x->m_Width;
		m_Height = x->m_Height;
	}


	void OnLoad(SDL_Surface* Surf_Temp)
	{
		m_Surf_Display = SDL_DisplayFormatAlpha(Surf_Temp);
	}

	void Draw(SDL_Surface* Surf_Window, int X, int Y)
	{
		SDL_Rect source ;
		switch(m_Type)
		{
		case(DROP_EGG):
			{
			SDL_Rect temp = {0, 0, EGG_WIDTH,EGG_HEIGHT};
			source = temp;
			}break;
		case(DROP_SHIT):
			{
			SDL_Rect temp = {0, 0, SHIT_WIDTH,SHIT_HEIGHT};
			source = temp;
			}break;
		}
		X = m_X;
		Y = m_Y;
		SDL_Rect destination = {X, Y, 
			NON_PLAYER_WIDTH,NON_PLAYER_HEIGHT};

		SDL_BlitSurface(m_Surf_Display, &source, Surf_Window, &destination);
	}

	void MoveDown()
	{
		if(m_Y < WINDOW_HEIGHT +100)
		{
			m_Y += m_SpeedY;
		}
	}

	DropType Get_DropType(){return m_Type;}

	int GetDrop_X(){return m_X;}
	int GetDrop_Y(){return m_Y;}

	void SetDrop_x(int x){m_X = x;}
	void SetDrop_y(int y){m_Y = y;}

	int GetDropSpeed_Y(){return m_SpeedY;}
	void SetDropSpeed_Y(int y){m_SpeedY = y;}

	int GetWidth(){return m_Width;}
	int GetHeight(){return m_Height;}

	void SetWidth(int x){m_Width = x;}
	void SetHeight(int y){m_Height = y;}

	int GetCatchState(){return CatchState;}
	void SetCatchState(bool c){CatchState = c;}

	int GetLifeState(){return LifeState;}
	void SetLifeState(bool c){LifeState = c;}

	int GetCountState(){return CountState;}
	void SetCountState(bool c){CountState = c;}
};